<?php
######################################################################
# [Indy]News hacking
#-------------------------
# Version: 1.1
#
# By : JoyDivision (Kolja)
# (http://www.bergamoblog.it)
# (gava@bergamoblog.it)
#
# Tech support on www.bergamoblog.it/forum.php
######################################################################
# This hacking is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
######################################################################
/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)            */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* =========================                                            */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$result = sql_query("select radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {
get_lang("IndyNews");
function getSelectTagClass($classid=""){
    global $prefix, $dbi;
    $result = sql_query("select id, class from ".$prefix."_media_class ORDER BY id", $dbi);
    $tag ="<select name='classid'>";
    $sel="";
    while(list($id, $class)=sql_fetch_row($result, $dbi)){
          if($classid==$id){
             $sel= " selected";
          }
          $tag.="<option value='$id'$sel>$class</option>";
          $sel="";
    }
    $tag.="</select>";
    return($tag);
}

function getSelectTagThumb($thumbnail="unknown.gif"){
    $tag="<SCRIPT language='javascript'>\n"
        ."<!--\n;"
        ."function showthumb(sel) {\n"
        ."if (!document.images)\n"
        ."return;\n"
        ."document.images.thumb.src=\n"
        ."'images/media/' + sel.options[sel.selectedIndex].value\n"
        ."}\n"
        ."//-->\n"
        ."</SCRIPT>\n\n";
    $tag.="<select name='thumbnail' onChange='showthumb(this);'>";
    $sel="";
    $Adir = @opendir(realpath("images/media"));
    $cont=0;
    while(false!==($thumb=readdir($Adir))) {
          if($thumb!="download.gif" && $thumb!="delete.gif"){
             $ext= explode(".",$thumb);
             $ext=$ext[count($ext)-1];
             if($ext!="" && stristr("jpg|gif|png|bmp",$ext)){
                $cont++;
                if($cont==1 && $thumbnail==""){
                   $selthumb="$thumb";
                }
                if($thumbnail==$thumb){
                   $sel = " selected";
                   $selthumb =$thumb;
                }
                $tag.="<option value='$thumb'$sel>$thumb</option>";
                $sel="";
             }
          }
    }
    $tag.="</select>&nbsp;<img name='thumb' src='images/media/$selthumb' border=0>";
    closedir($Adir);
    return($tag);
}

function getSelectTagEmbed($embed=0){
    if($embed==0){
       $seln = " selected";
       $sely = "";
    }else{
       $seln = "";
       $sely = " selected";
    }
    $tag ="<select name='enableEmbed'><option value='0'$seln>"._NO."</option><option value='1'$sely>"._YES."</option></select>";
    return($tag);
}

function getSelectTagThumbLib($enablThumb=0){
    global $NetPBMLibDir;
    switch($enablThumb){
       case 0:
         $sel0=" selected";
         $sel1="";
         $sel2="";
         $sel3="";
         break;
       case 1:
         $sel0="";
         $sel1=" selected";
         $sel2="";
         $sel3="";
         break;
       case 2:
         $sel0="";
         $sel1="";
         $sel2=" selected";
         $sel3="";
         break;
       case 3:
         $sel0="";
         $sel1="";
         $sel2="";
         $sel3=" selected";
         break;
    }
    //check if GD-Library are Installed on Server
    if(function_exists("imagecreate")){
       $optGDLib =  "<option value='1'$sel1>GD library 1.6</option><option value='3'$sel3>GD library 2.0 or later</option>";
    }
    //check if netPBM are Installed
    if(file_exists(realpath($NetPBMLibDir)."/pnmtopng")){
       $optNetPBM = "<option value='2'$sel2>netPBM Library</option>";
    }
    $tag ="<select name='enablThumb'><option value='0'$sel0>"._NO."</option>".$optGDLib.$optNetPBM."</select>";
    return($tag);
}

function getSelectTagView($view=0){
    if($view==0){
       $seln = " selected";
       $sely = "";
    }else{
       $seln = "";
       $sely = " selected";
    }
    $tag ="<select name='enableView'><option value='0'$seln>"._NO."</option><option value='1'$sely>"._YES."</option></select>";
    return($tag);
}

function getTemplTag($tmplArt){
    global $MediaTemplArtDir;
    $sel="";
    $tag1.="<select name='tmplArt'>";
    $Adir = @opendir(realpath("$MediaTemplArtDir"));
    $cont=1;
    while(false!==($templ=readdir($Adir))) {
          if(stristr($templ,".mta")){
                if(false!==($templData=getTemplArt($templ))){
                   if($templ==$tmplArt){
                      $sel = " selected";
                   }
                   $tag1.="<option value='$templ'$sel>$templData[tit]</option>";
                   $sel="";
                   $cont++;
                }
          }
    }
    closedir($Adir);
    return($tag1);
}

function MediaAdmin() {
    global $prefix, $dbi, $admin, $bgcolor2, $bgcolor4;
    include ("config.php");
    include ("header.php");
    GraphicAdmin();
    OpenTable();
    echo "
    <center><b>Menu</b></center>
    <center><a href=admin.php?op=MediaConfigEdit><b>"._MEDIAGLOBALPARMS."</b></a>&nbsp;|&nbsp;<a href=admin.php?op=MediaNewsAdmin><b>"._MEDIANEWSADMIN."</b></a></center>";
    CloseTable();
    echo"<br>";
    OpenTable();
    echo "
    <center><h4><b>"._MEDIATYPES."</b></h4></center>
    <center><table border=1 width=100%><tr>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIATYPESEXT."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIATYPESCLASS."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIATYPESMIME."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIATYPESEMBED."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIATYPESVIEW."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._FUNCTIONS."</b></td></tr>";
    // $result = sql_query("select mt.ext, mt.classid, mc.class, mt.mimetype, mt.enableEmbed, mt.enableView from ".$prefix."_media_types mt INNER JOIN ".$prefix."_media_class mc ON (mt.classid=mc.id) ORDER BY mt.classid, mt.ext", $dbi);
    $result = sql_query("select mt.ext, mt.classid, mc.class, mt.mimetype, mt.enableEmbed, mt.enableView from ".$prefix."_media_types mt, ".$prefix."_media_class mc WHERE mt.classid=mc.id ORDER BY mt.classid, mt.ext", $dbi);
    while(list($ext, $classid, $class, $mimetype, $enableEmbed, $enableView) = sql_fetch_row($result, $dbi)) {
           echo "
        <td align=center>$ext</td>
        <td align=center>$class</td>
        <td align=center>$mimetype</td>";
        if($enableEmbed){
           echo "<td align=center>"._YES."</td>";
        }else{
           echo "<td align=center>"._NO."</td>";
        }
        if($enableView){
           echo "<td align=center>"._YES."</td>";
        }else{
           echo "<td align=center>"._NO."</td>";
        }
        echo"<td align=center>[<a href=admin.php?op=MediaTypeEdit&ext=$ext>"._MODIFY."</a> | <a href=admin.php?op=MediaTypeGoDel&ext=$ext&ok=0>"._DELETE."</a>]</td><tr>";
    }
    echo "</table>
    <br><br>
    <font size=4><b>".ADD." "._MEDIATYPES."</center></b><br><br>
    <font size=2>
    <form action=admin.php method=post>
    <table border=0 width=100%>
    <tr><td valign=top>"._MEDIATYPESEXT." :</td><td valign=top><input type=text name=ext size=10></td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESCLASS." :</td><td valign=top>".getSelectTagClass()."</td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESMIME." :</td><td valign=top><input type=text name=mimetype size=50></td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESEMBED." :</td><td valign=top>".getSelectTagEmbed()."</td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESEMBEDTAG." :<br>"._MEDIATYPESEMBEDTAGINFO."</td><td valign=top><textarea name=displaytag rows=5 cols=50></textarea></td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESVIEW." :</td><td valign=top>".getSelectTagView()."</td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESTHUM." :</td><td valign=top>".getSelectTagThumb()."</td></tr><tr><td>
    </td></tr>
    </table>
    <input type=hidden name=op value='MediaTypeGoAdd'>
    <input type=submit value='"._ADD."'>&nbsp;&nbsp<input type=button value='"._CANCEL."' onclick=\"document.location.href='admin.php?op=MediaAdmin';\">
    </form>
    </td></tr></table></td></tr></table>";
    include("footer.php");
}

function MediaTypeEdit($ext) {
    global $prefix, $admin, $dbi;
    include ("config.php");
    include ("header.php");
    GraphicAdmin();
    $result = sql_query("select ext, classid, enableEmbed, enableView, mimetype, displaytag, thumbnail from ".$prefix."_media_types where ext='$ext'", $dbi);
    $RsMType = sql_fetch_array($result, $dbi);
    $RsMType[mimetype] = stripslashes($RsMType[mimetype]);
    $RsMType[displaytag] = stripslashes($RsMType[displaytag]);
    OpenTable();
    echo "
    <center><font size=4><b>"._MODIFY." "._MEDIATYPES."</b></font></center>
    <form action=admin.php method=post>
    <input type='hidden' name='ext' value='$ext'>
    <table border=0 width=100%>
    <tr><td valign=top>"._MEDIATYPESEXT." :</td><td valign=top><b>$ext</b></td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESCLASS." :</td><td valign=top>".getSelectTagClass($RsMType[classid])."</td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESMIME." :</td><td valign=top><input type=text name=mimetype size=50 value='$RsMType[mimetype]'></td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESEMBED." :</td><td valign=top>".getSelectTagEmbed($RsMType[enableEmbed])."</td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESEMBEDTAG." :<br>"._MEDIATYPESEMBEDTAGINFO."</td><td valign=top><textarea name=displaytag rows=5 cols=50>$RsMType[displaytag]</textarea></td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESVIEW." :</td><td valign=top>".getSelectTagView($RsMType[enableView])."</td></tr><tr><td>
    <tr><td valign=top>"._MEDIATYPESTHUM." :</td><td valign=top>".getSelectTagThumb($RsMType[thumbnail])."</td></tr><tr><td>
    </td></tr>
    </table>
    <input type=hidden name=op value='MediaTypeGoSave'>
    <input type=submit value='"._SAVE."'>&nbsp;&nbsp<input type=button value='"._CANCEL."' onclick=\"document.location.href='admin.php?op=MediaAdmin';\">
    </form>";
    CloseTable();
    include("footer.php");
}

function MediaTypeGoSave($ext, $classid, $enableEmbed, $enableView, $mimetype, $displaytag, $thumbnail) {
    global $prefix, $dbi;
    $mimetype = addslashes($mimetype);
    $displaytag = addslashes($displaytag);
    sql_query("update ".$prefix."_media_types set classid=$classid, enableEmbed=$enableEmbed, enableView=$enableView, mimetype='$mimetype', displaytag='$displaytag', thumbnail='$thumbnail' where ext='$ext'", $dbi);
    Header("Location: admin.php?op=MediaAdmin");
}

function MediaTypeGoAdd($ext, $classid, $enableEmbed, $enableView, $mimetype, $displaytag, $thumbnail) {
    global $prefix, $dbi;
    $mimetype = addslashes($mimetype);
    $displaytag = addslashes($displaytag);
    sql_query("insert into ".$prefix."_media_types values('$ext', $classid, $enableEmbed, $enableView, '$mimetype', '$displaytag', '$thumbnail')", $dbi);
    print(mysql_error());
    Header("Location: admin.php?op=MediaAdmin");
}

function MediaTypeGoDel($ext, $ok=0) {
    global $prefix, $dbi;
    if($ok==1) {
        sql_query("delete from ".$prefix."_media_types where ext='$ext'", $dbi);
        Header("Location: admin.php?op=MediaAdmin");
    } else {
        include("header.php");
        GraphicAdmin();
        OpenTable();
        echo "<center><br>";
        echo "<font size=3 color=Red>";
        echo "<b>"._MEDIATYPESDELCONF."</b><br><br><font color=Black>";
        echo "[<a href=admin.php?op=MediaTypeGoDel&ext=$ext&ok=1>"._YES."</a> | <a href=admin.php?op=MediaAdmin>"._NO."</a>]<br><br>";
        CloseTable();
        include("footer.php");
        }
}

function MediaConfigEdit() {
    global $prefix, $admin, $dbi;
    //check if GD-Library are Installed on Server
    $libGDExist=false;
    if(function_exists("imagecreate")){
       $libGDExist=true;
    }
    include ("config.php");
    include ("header.php");
    GraphicAdmin();
    $result = sql_query("select admUpSize, usrUpSize, anmUpSize, UnpFType, enablThumb, numNewsImg, posNewsImg, imgIndDefW, imgIndDefH, imgArtDefW, imgArtDefH, tmplArt from ".$prefix."_media_config where id=1", $dbi);
    $RsMConf = sql_fetch_array($result, $dbi);
    $RsMConf[UnpFType] = stripslashes($RsMConf[UnpFType]);
    OpenTable();
    echo "
    <center><b>Menu</b></center>
    <center><a href=admin.php?op=MediaAdmin><b>"._MEDIATYPES."</b></a>&nbsp;|&nbsp;<a href=admin.php?op=MediaNewsAdmin><b>"._MEDIANEWSADMIN."</b></a></center>";
    CloseTable();
    echo"<br>";
    OpenTable();
    echo "
    <center><font size=4><b>"._MODIFY." "._MEDIAGLOBALPARMS."</b></font></center>
    <form action=admin.php method=post>
    <input type='hidden' name='ext' value='$ext'>
    <table border=0 width=100%>
    <tr><td valign=top>"._MEDIAGPUPSIZEADM.":</td><td valign=top><input type=text name=admUpSize size=10 value='$RsMConf[admUpSize]'></td></tr>
    <tr><td valign=top>"._MEDIAGPUPSIZEUSR.":</td><td valign=top><input type=text name=usrUpSize size=10 value='$RsMConf[usrUpSize]'></td></tr>
    <tr><td valign=top>"._MEDIAGPUPSIZEANM.":</td><td valign=top><input type=text name=anmUpSize size=10 value='$RsMConf[anmUpSize]'></td></tr>
    <tr><td valign=top>"._MEDIAGPNOTUPEXT.":</td><td valign=top><input type=text name=UnpFType size=50 value='$RsMConf[UnpFType]'></td></tr>";
    echo"<tr><td valign=top>"._MEDIAENABLTHUMB.":<br>"._MEDIAENABLTHUMBWARN."</td><td valign=top>".getSelectTagThumbLib($RsMConf[enablThumb])."</td></tr>";
    echo"
    <tr><td valign=top>"._MEDIAGPNEWSINHOME.":</td><td valign=top><input type=text name=numNewsImg size=10 value='$RsMConf[numNewsImg]'></td></tr>
    <tr><td valign=top>"._MEDIAGPNEWPOS.":</td><td valign=top><select name=posNewsImg>";
    switch($RsMConf[posNewsImg]){
           case "sx":
                 $sxSel=" selected";
                 break;
           case "sa":
                 $saSel=" selected";
                 break;
           case "dx":
                 $dxSel=" selected";
                 break;
           case "da":
                 $daSel=" selected";
                 break;
    }
    echo "<option value='sx'$sxSel>"._MEDIAGPNEWPOSSX."</option>
    <option value='sa'$saSel>"._MEDIAGPNEWPOSSA."</option>
    <option value='dx'$dxSel>"._MEDIAGPNEWPOSDX."</option>
    <option value='da'$daSel>"._MEDIAGPNEWPOSDA."</option></select></td></tr>
    <tr><td valign=top>"._MEDIAGPHOMEWIDTH.":</td><td valign=top><input type=text name=imgIndDefW size=10 value='$RsMConf[imgIndDefW]'></td></tr>
    <tr><td valign=top>"._MEDIAGPHOMEHEIGH.":</td><td valign=top><input type=text name=imgIndDefH size=10 value='$RsMConf[imgIndDefH]'></td></tr>
    <tr><td valign=top>"._MEDIAGPNEWSWIDTH.":</td><td valign=top><input type=text name=imgArtDefW size=10 value='$RsMConf[imgArtDefW]'></td></tr>
    <tr><td valign=top>"._MEDIAGPNEWSHEIGH.":</td><td valign=top><input type=text name=imgArtDefH size=10 value='$RsMConf[imgArtDefH]'></td></tr>
    <tr><td valign=top>"._MEDIAGPTEMMPLART.":</td><td valign=top>".getTemplTag($RsMConf[tmplArt])."</td></tr>
    </table>
    <input type=hidden name=op value='MediaConfigGoSave'>
    <input type=submit value='"._SAVE."'>&nbsp;&nbsp<input type=button value='"._CANCEL."' onclick=\"document.location.href='admin.php?op=MediaAdmin';\">
    </form>";
    CloseTable();
    include("footer.php");
}

function MediaConfigGoSave($admUpSize, $usrUpSize, $anmUpSize, $UnpFType, $enablThumb, $numNewsImg, $posNewsImg, $imgIndDefW, $imgIndDefH, $imgArtDefW, $imgArtDefH, $tmplArt) {
    global $prefix, $dbi;
    sql_query("update ".$prefix."_media_config set admUpSize=$admUpSize, usrUpSize=$usrUpSize, anmUpSize=$anmUpSize, UnpFType='$UnpFType', enablThumb=$enablThumb, numNewsImg=$numNewsImg, posNewsImg='$posNewsImg',imgIndDefW=$imgIndDefW, imgIndDefH=$imgIndDefH, imgArtDefW=$imgArtDefW, imgArtDefH=$imgArtDefH, tmplArt='$tmplArt' where id=1", $dbi);
    Header("Location: admin.php?op=MediaConfigEdit");
}

function filterMedia($MediaFiles, $IdMediaAss){
    $conta = 0;
    $filteredMedia = Array();
    foreach($MediaFiles as $MediaFile){
       if(!(strpos($MediaFile[fname],$IdMediaAss) === false)){
          $filteredMedia[][fname]= $MediaFile[fname];
          $filteredMedia[$conta][fsize] = $MediaFile[fsize];
          $conta++;
        }
    }
    return($filteredMedia);
}

function MediaNewsAdmin($MPos, $MSort) {
    global $prefix, $dbi, $admin, $bgcolor2, $bgcolor4;
    $NumNewsPerPage = 20;
    include ("config.php");
    include ("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<a name=MediaMenu>
    <center><b>Menu</b></center>
    <center><a href=admin.php?op=MediaConfigEdit><b>"._MEDIAGLOBALPARMS."</b></a>&nbsp;|&nbsp;<a href=admin.php?op=MediaAdmin><b>"._MEDIATYPES."</b></a></center>";
    CloseTable();
    echo"<br>";
    OpenTable();
    $result = sql_query("select count(*) from ".$prefix."_stories where has_media=1", $dbi);
    list($TotRows) = sql_fetch_row($result, $dbi);
    if($MSort==""){
       $MSort ="DD";
    }
    if($MPos==""){
       $MPos=0;
    }
    echo "
    <center><h4><b>"._MEDIANEWSADMIN."</b></h4></center>
    <center><table border=0 width=100%><tr><td align=left>";
    if($MPos>0){
       echo "<a href=\"admin.php?op=MediaNewsAdmin&MPos=".($MPos-$NumNewsPerPage)."&MSort=$MSort#MediaMenu\"><== Prev</a>";
    }else{
              echo "&nbsp;";
    }
    echo "</td><td align=right>";
    if(($MPos+$NumNewsPerPage)<$TotRows){
       echo "<a href=\"admin.php?op=MediaNewsAdmin&MPos=".($MPos+$NumNewsPerPage)."&MSort=$MSort#MediaMenu\">Next ==></a>";
    }else{
              echo "&nbsp;";
    }
    echo "</td></tr></table>";
    echo "<table border=1 width=100%><tr>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIANEWSID."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIANEWSTITLE."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIANEWSDATE."&nbsp;(<a href=\"admin.php?op=MediaNewsAdmin&MPos=0&MSort=DA#MediaMenu\">A</a>/<a href=\"admin.php?op=MediaNewsAdmin&MPos=0&MSort=DD#MediaMenu\">D</a>)</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIANUMBER."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._MEDIATOTSIZE."</b></td>
        <td bgcolor=$bgcolor2><font color=white><center><b>"._FUNCTIONS."</b></td></tr>";
    // $result = sql_query("select mt.ext, mt.classid, mc.class, mt.mimetype, mt.enableEmbed, mt.enableView from ".$prefix."_media_types mt INNER JOIN ".$prefix."_media_class mc ON (mt.classid=mc.id) ORDER BY mt.classid, mt.ext", $dbi);
    $sqlquery = "select sid, title, time from ".$prefix."_stories where has_media=1";
    //SQL ORDER BY
    switch($MSort){
       case "DA":
            $sqlquery.= " ORDER BY time ASC";
            break;
       case "DD":
            $sqlquery.= " ORDER BY time DESC";
            break;
       default:
            $sqlquery.= " ORDER BY time DESC";
            break;
    }
    //SQL LIMIT
    $sqlquery.= " LIMIT $MPos, $NumNewsPerPage";
    $result = sql_query("$sqlquery", $dbi);
    $MediaListDetail = GetMediaListDetail();
    while(list($sid, $title, $time) = sql_fetch_row($result, $dbi)) {
           echo "
        <td align=center>$sid</td>
        <td align=center>$title</td>
        <td align=center>$time</td>";
        $SelMedia = filterMedia($MediaListDetail,md5("s".$sid));
        $Size = 0;
        foreach($SelMedia as $MediaFile){
             $Size+= $MediaFile[fsize];
        }
        $Size = $Size / 1024;
        echo "<td align=right>".count($SelMedia)."&nbsp;</td>";
        echo "<td align=right>".number_format ( $Size, 2, ',', '.')."&nbsp;Kb</td>";
        echo"<td align=center>[<a href=admin.php?op=EditStory&sid=$sid>"._MODIFY."</a> | <a href=admin.php?op=RemoveStory&sid=$sid>"._DELETE."</a>]</td><tr>";
    }
    echo "</table>";
    include("footer.php");
}

function sfFixHasMediaBug(){
         global $prefix, $dbi;
         $res = sql_query("select sid from ".$prefix."_stories where has_media=1", $dbi);
         while(list($sid)=sql_fetch_row($res, $dbi)){
           if(!checkMediaExist("s".$sid)){
              sql_query("update ".$prefix."_stories set has_media=0 where sid=$sid", $dbi);
           }
         }
         echo "OK.. Bug Fixed :)";
}

} else {
    echo "Access Denied";
}
?>
